package xin.nick.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import xin.nick.demo.config.ServerConfig;

import javax.servlet.http.HttpSession;

/**
 * @author Nick
 * @date 2021/6/27
 * @description
 */
@RestController
public class CommonController {

    @Autowired
    private ServerConfig serverConfig;

    @RequestMapping("/getInfo")
    public String getInfo(HttpSession session) {

        System.out.println("----------> getInfo");

        return "当前项目: xxx, \n" +
                " 端口:" + serverConfig.getServerPort() + "\n" +
                " sessionId: " + session.getId();
    }

}
